<?php
function getmicrotime1(){ 
    list($usec, $sec) = explode(" ",microtime()); 
    return ((float)$usec + (float)$sec); 
}
  //$tmpfile = fopen("test.txt","w");
  /*foreach ($_SERVER as $key => $value) {
   //echo "Key: $key; Value: $value<br>\n";
   $fp = fwrite($tmpfile, "Key: $key; Value: $value\n");
  }*/
/*  foreach ($_GET as $key => $value) {
    //echo "Key: $key; Value: $value<br>\n";
    $fp = fwrite($tmpfile, "\nKey: $key; Value: $value; Hex: ".urlencode($value)."; Codepage: ".mb_detect_encoding($value)."\n");
    $ttt = str_replace("-", "&#", $value);
    $fp = fwrite($tmpfile, "TTT: $ttt\n");
    $decodedStr = utf8Encode($ttt, $tmpfile);
    $fp = fwrite($tmpfile, "UTF-8: $decodedStr; Codepage: ".mb_detect_encoding($decodedStr)."\n");
  }
  fclose($tmpfile);*/

/*  $file=fopen('log.txt', "a");
  fwrite($file, "Start Loading Page: ".date ("l dS of F Y h:i:s A")." Uinx timestamp: ".time()."\n");
  fclose($file);
*/
  $generationtime = getmicrotime1();
  include "sessions.php";
    $generationtime = getmicrotime1() - $generationtime;
    if (!$file=fopen('ontoedit/time.log', "w")){
  		echo("<script>alert('Could not create file time.log');</script>");
    }else{
      fwrite($file, "Class data index:\n".$generationtime);
      fclose($file);
    };
/*
  $file=fopen('log.txt', "a");
  fwrite($file, "End Loading Page: ".date ("l dS of F Y h:i:s A")." Uinx timestamp: ".time()."\n");
  fclose($file);
*/
?>